package wfl.spec.edu;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    Button one;
    Button twe;
    Button three;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        one = (Button) findViewById(R.id.button_1);
        twe = (Button) findViewById(R.id.button_2);
        three = (Button) findViewById(R.id.button_3);
        one.setOnClickListener(btnlistener);
        twe.setOnClickListener(btnlistener);
        three.setOnClickListener(btnlistener);
    }
    private View.OnClickListener btnlistener=new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (v.getId() == R.id.button_1) {
                Intent intent = new Intent();
                intent.setClass(MainActivity.this,ActivityFirst.class);
                startActivity(intent);
            }else if (v.getId() == R.id.button_2) {
                Intent intent = new Intent();
                intent.setClass(MainActivity.this,ActivitySecond.class);
                startActivity(intent);
            }
        }
    };
}

